package cn.com.cym.gamezao.entity.xmu.recruit;

import cn.com.cym.gamezao.base.BaseEntity;
import cn.com.cym.gamezao.entity.authorize.User;
import cn.com.cym.gamezao.entity.xmu.Recruit;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.lang.NonNull;

import javax.persistence.*;
import java.io.Serializable;
import java.time.LocalDate;

@Setter
@Getter
@NoArgsConstructor
@Table(name = "x_work_experience")
@Entity
@Accessors(chain = true)
@ApiModel(description = "工作经历")
public class WorkExperience extends BaseEntity implements Serializable {
    private static final long serialVersionUID = 4286136105001441397L;

    /*@ManyToOne
    @JoinColumn(name = "recruit_id")
    @JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
    private Recruit recruit;*/
    @ManyToOne
    @JoinColumn(name = "user_id")
    @JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
    private User user;


    @JsonFormat(pattern = "yyyy-MM-dd",timezone="GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @ApiModelProperty(name = "startDate",value = "开始时间",dataType = "LocalDate")
    @NonNull
    private LocalDate startDate;

    @JsonFormat(pattern = "yyyy-MM-dd",timezone="GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @ApiModelProperty(name = "endDate",value = "结束时间",dataType = "LocalDate")
    private LocalDate endDate;


    /**
     * 工作单位
     */
    @Column(length = 48)
    private String company;

    /**
     * 部门
     */
    private String department;

    /**
     * 职务
     */
    @Column(length = 36)
    private String duties;

    /**
     * 医院等级
     */
    private String hospitalLevel;
}
